home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(status == "active" && this._x >= _root.RIGHT_BOUND)
- {
- if(_root.coral.hitTest(this._x,this._y,true) == true)
- {
- vSideOfImpact = "undetermined";
- vPixelCounter = Number(1);
- while(vSideOfImpact == "undetermined")
- {
- if(_root.coral.hitTest(this._x,Number(this._y + Number(vPixelCounter)),true) == false && Number(this._y + Number(vPixelCounter)) < _root.BOTTOM_BOUND)
- {
- vSideOfImpact = "top";
- vPixelOffset = vPixelCounter + Number(this._height);
- }
- else if(_root.coral.hitTest(this._x,Number(this._y - Number(vPixelCounter)),true) == false && _root.TOP_BOUND < Number(this._y - Number(vPixelCounter)))
- {
- vSideOfImpact = "bottom";
- vPixelOffset = vPixelCounter + Number(this._height);
- }
- vPixelCounter++;
- }
- if(vSideOfImpact == "top")
- {
- setProperty(this, _Y, Number(this._y + Number(vPixelOffset)));
- }
- else if(vSideOfImpact == "bottom")
- {
- setProperty(this, _Y, Number(this._y - Number(vPixelOffset)));
- }
- }
- }
- else if(status == "active" && this._x < _root.RIGHT_BOUND && _root.recruit.diver.hitTest(this._x,this._y,false) == true)
- {
- status = "neutralized";
- this.gotoAndPlay("neutralized");
- _root.fnScorePoints();
- }
- }
-